import React,{Suspense} from 'react';
import ReactDOM from 'react-dom/client';  
// import App from './App';
import "./App.css"
import router from '@/router';
import store from './store';
import {Provider} from 'react-redux'
import Toast from "@/components/Toast/Toast"
import Loading from "@/components/Loading/Loading"
// import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
  <Provider store={store}>
    <Toast />
    {/* router是个变量,写在Provider组件中 ,需要加{}*/}
    {/* 懒加载通常配合Suspense使用,fallback里面设置 加载的动画效果 */}
    <Suspense fallback={<Loading></Loading>}>
      {router} 
      {/*  */}
    </Suspense>
  </Provider>
    
);


